<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
    <meta charset="UTF-8">
    <title>文明互动</title>
    <meta name="page-view-size" content="1280*720">
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/interactive.css">
    <script type="text/javascript" src="../lib/js/evm.js"></script>
    <script type="text/javascript" src="../lib/js/Evm_djyw.js"></script>
    <script type="text/javascript" src="../lib/js/key.js"></script>
    <script src="../lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/api.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/public.js" type="text/javascript" charset="utf-8"></script>
    <style>
      
    </style>
</head>

<body>
  <marquee behavior="" direction="">欢迎您进入凤阳县新时代文明实践中心！</marquee>
  <div class="volunteer-bg" id="volunteerMain">
        <ul class="nav-bg" id="nav-bg">
        </ul>

        <!-- 下左侧模块 -->
        <ul id="menu_bg" class="menu-bg">



        </ul>


        <div class="list-bg">
            <div class="list-con" id="list-con"></div>
            <p class="page-show" id="page_show"><span id="now_page">0</span>/<span id="total_page">0</span>

            </p>
        </div>

    </div>

    </div>

</body>
<script>
  var modelIndex = {
      index: 0, //导航栏初始位置
      menuKey: '',
      menuPageSize: 3, //导航栏模块数量
      pageSize: 1, //主模块数量
      type: '',
      crumbs: '文明互动',
      structure: 2, //上下结构  默认1是左右，2是上下结构
      menuContainerId: 'nav-bg', //包含导航栏模块的标签id
      menuListName: 'nav', //导航栏模块名称class
      mainContainerId: 'list-con', //包含主模块的标签id
      mainlistName: '', //主模块名称
      id: 'interactive',
  }

  var leftData = [
    {
        name: '便民服务', //name
        id: '1111', //唯一标识
        type_style: '', //类别
        size: '7', //数量  
        list_name: 'list-type', //右侧模块classname
        // rowHeight: 4,
        menuList: [
            {
                title: '警匪<span>110</span>',
                id: '354'
            },
            {
                title: '医疗救护<span>120</span>',
                id: '320'
            },
            
            {
                title: '交通事故<span>122</span>',
                id: '321'
            },
            {
                title: '水上救援<span>12395</span>',
                id: '322'
            },
            {
                title: '森林火警<span>12119</span>',
                id: '319'
            },
            {
                title: '红十字会<span>010-84025890</span>',
                id: '315'
            },
            {
                title: '供电局<span>95598</span>',
                id: '358'
            },
            {
                title: '天气预报<span>12121</span>',
                id: '358'
            },
        ]
    },
    {
        name: '互帮互助', //name
        id: '3', //唯一标识
        type_style: '1', //类别
        size: '4', //数量  
        list_name: 'list-row', //右侧模块classname
        // is_cur: 'true'
    },
    {
        name: '帮扶墙', //name
        id: '2222', //唯一标识
        type_style: '0', //类别
        size: '0', //数量  
        list_name: 'list-content' //右侧模块classname
    }
    ];




    function getMenus(page, number) {
        if (typeof number == 'number') {
            // modelIndex.mainContainerId = leftData[number].list_name;
        }
        left.paint(page, number);

    }

    function getMessage(id, page, pos, index) { //id,类型，页码，上下页，位置
      console.log(id, page, pos, index,modelIndex.menuKey)
      var params = {
          // cid: id,
          page: page,
          pagesize: modelIndex.pageSize,
          // month: modelIndex.menuKey || ''
          // area_id: $.cookie('TV_CST_AREA')
      }

      if (id == '284') {   //志愿者招募
        GetDatas('volunteerGroupList', params, function (res, data) {
          var mess = data.data;
          console.log(mess.items, 111111111111)
          var str = '';               
          if (mess.items.length) {
            $('.page-show').css('display', 'block')
            for (var i = 0; i < mess.items.length; i++) {
              str += '<div class="' + modelIndex.mainlistName + '" data-id=' + mess.items[i].id +
                  " data-tpe=" + mess.items[i].tpe + " >";
              //是否有logo图片    
              if (mess.items[i].logo != "") {
                  str += "<img class='list-img' src=" + API_URL.imgURL + mess.items[i].logo + ">"
              } else {
                  str += '<img src="../images/base.png" alt="">'
              }
              //标题 人数 
              str += '<div class="list-title">"' + mess.items[i].title + '"</div>'
              str +='<div class="list-member">' + mess.items[i].volunteers + '</div>'

              str += '</div>'
            }
          } else {
              str = '<h1>暂无数据</h1>'
              $('.page-show').css('display', 'none')
          }
          $('#' + modelIndex.mainContainerId).html(str);
          MessOpt(page, mess.totalpage, pos, index);
        })
      } else if (id == '1111') {
          console.log(modelIndex.menuKey)
          var str ='';
          str += '<div class="title">镇村紧急联系人</div>'
          str += '<div class="num-container">'
          var  data =[
            {id:1,address:'汇龙镇',people:'赵志',phone:'1736525284'},
            {id:1,address:'北新镇',people:'张勇',phone:'1802147512'},    
            {id:1,address:'惠萍镇',people:'孙杨',phone:'1821452647'},    
            {id:1,address:'寅阳镇',people:'李明',phone:'1736525274'},    
            {id:1,address:'东海镇',people:'周华',phone:'1736525249'},    
            {id:1,address:'近海镇',people:'吴平',phone:'1736525255'},    
            {id:1,address:'南阳镇',people:'郑东',phone:'1736525295'},    
        ]
          for(var i = 0; i < data.length; i++ ){
            str += '<div class="contacter">' + data[i].address + '<span>' +data[i].people + '</span><span>'+data[i].phone+'</span></div>'
          }
          str += '</div>'
          $('.page-show').css('display', 'none')
          $('#' + modelIndex.mainContainerId).html(str);
  //         GetDatas('getShareList', {
  //           // share_type:'1'
  //             id: modelIndex.menuKey||1
  //         }, function (res, data) {
  //             console.log(data.data)
  //             var str = '';
  //             var mess = data.data;
  // //---------------------------------------------
  //             if (mess) {
  //                 for (var i = 0; i < mess; i++) {
  //                 }
  //             }else{
  //               str = '<h1>暂无数据</h1>'
  //             }
  //             $('.page-show').css('display', 'none')
  //             $('#' + modelIndex.mainContainerId).html(str);
  //             MessOpt(page, mess.totalpage, pos, index);
  //         })
      } else if(id == '3') {
        var params = {
          // status:0,
          page: page,
          pagesize: modelIndex.pageSize,
          // month: modelIndex.menuKey || ''
          // area_id: $.cookie('TV_CST_AREA')
      }
          GetDatas('getHelpList', params, function (res, data) {
            var mess = data.data;
            console.log(mess.items)
            var str = '';
            if (mess.items.length) {
              for (var i = 0; i < mess.items.length; i++) {
                $('#page_show').css('display', 'block');
                str += '<div class="' + modelIndex.mainlistName + '" data-id=' + mess.items[i].id +
                        " data-tpe=" + mess.items[i].tpe + " >";
                if(modelIndex.mainlistName == 'list-row'){
                  str += '<div class="list-info">'
                  //图片                      
                  var img = '';
                  if (!mess.items[i].images) {
                      img = '../images/base.png'
                  } else {
                      img = API_URL.imgURL + mess.items[i].images
                  }
                  str += '<div class="list-imgBar">'
                  str += "<img class='list-img' src=" + img + ">";
                  str += '</div>'
                  //标题
                  str += "<div class='list-title'><p class='ell'>" + mess.items[i].title + "</p></div>";
                  //简介 时间
                  str +="<div class='list-address'>" + mess.items[i].address + "</div>"
                  str += "<div class='list-start-time'>" + mess.items[i].format_add_time + "</div>"
                  //info结束
                  str += '</div>'

                  //活动状态
                  str += '<div class="list-status">'
                  if(mess.items[i].status == 3){
                    str += '<img src="../images/icon-2.png">'
                  }else if(mess.items[i].status == 2){
                    str += '<img src="../images/icon-1.png">'
                  }else {
                    str += '<img src="../images/icon-0.png">'
                  }
                  str += '</div>'

                  str += '</div>'
                }else if(modelIndex.mainlistName =='list-video'){
                  var img = '';
                  if (mess.items[i].images == '') {
                      img = '../images/base.png'
                  } else {
                      img = API_URL.imgURL + mess.items[i].images
                  }
                  str += '<div class="list-imgBar">'
                  str += "<img class='list-img' src=" + img + ">";
                  str += '</div>'
                  if (mess.items[i].tpe == 5 || mess.items[i].tpe == 4) {
                    str += "<div class='listPlay' ><img src='../images/play.png'></div>";
                  }
                  str += "<div class='list-title'><p class='ell'>" + mess.items[i].title + '</p></div>'
                  str += '</div>'
                }            
              }
            } else {
                str = '<h1>暂无数据</h1>'
                $('.page-show').css('display', 'none')
            }
            $('#now_page').html(page)
            $('#total_page').html(mess.totalpage)
            $('#' + modelIndex.mainContainerId).html(str);
            MessOpt(page, mess.totalpage, pos, index);
        })
      } else if( id == '2222'){
        var params ={
          pageSize:7
        }
        GetDatas('getHelpWall', params, function (err, res) {
          var str = '';
          // console.log(res);
          var mess = res.data;
          console.log(mess)
          str +='<marquee id="marquee" direction="up" scrollamount="5">'
          for(var i = 0; i <mess.items.length;i++){
            str += "<div class='ruleTitle'>" + mess.items[i].content + "</div>"
          }
          str += '</marquee>'
          // str += "<div class='ruleTitle'>" + res.data.title + "</div>"
          // str += "<div  class='ruleContent'>11</div>"
          $('#' + modelIndex.mainContainerId).html(str);
          $('.page-show').css('display', 'none')
        })  
      }
    }
    function direEnter(status, id, index) {
        if (status == 0) {
            TV.PromptMsg('报名成功')
            new TV.CookieOpt().clean();
        } else {
            if (id == 3) {
                window.location.href = "helpDetail.html?id=" + $('.active').attr('data-id');
                return
            }
            if (id == 284) {
                window.location.href = "teamDetail.html?id=" + $('.active').attr('data-id');
                return
            }
            if (id == 302) {
                window.location.href = "sesameList.html?id=" + $('.active').attr('data-id');
                return
            }
            var tpe = $('.active').attr('data-tpe');
            if (tpe == 4 || tpe == 5) {
                window.location.href = 'play.html?id=' + $('.active').attr('data-id');
            } else if (tpe == 1 || tpe == 2 || tpe == 3) {
                // if (tpe == 3) {
                //     window.location.href = './carrousel.html?id=' + $('.active').attr('data-id')
                //     return
                // }
                window.location.href = 'articleDetail.html?id=' + $('.active').attr('data-id') + '&type=' + $(
                    '.focus_menu').attr('data-id');
            }
        }



    }
</script>
<script type="text/javascript" src="../js/twoPageList-1.js"></script>

</html>